package com.springboot.autoconfigure.oss.model;

import com.google.gson.JsonObject;
import lombok.Builder;
import lombok.Data;

/**
 * oss文件操作换回对象
 * @author @zehua
 */
@Data
@Builder
public class FileOssOperationStatus<T> {
    /**
     * 是否成功
     */
    private boolean success;
    /**
     * msg
     */
    private String msg;

    private Object data;

    public static FileOssOperationStatus suceess(){
        return  FileOssOperationStatus.builder().success(true).msg("操作成功").build();
    }
    public static FileOssOperationStatus suceessData(Object data){
        return  FileOssOperationStatus.builder().success(true).msg("操作成功").data(data).build();
    }


    public static FileOssOperationStatus fail(){
        return  FileOssOperationStatus.builder().success(false).msg("操作失败").build();
    }

    public static FileOssOperationStatus fail(String msg){
        return  FileOssOperationStatus.builder().success(false).msg(msg).build();
    }

}
